import request from "@/utils/request";

// 查询试题列表
export function listTopic(query) {
  return request({
    url: "/exam/topic/list",
    method: "get",
    params: query,
  });
}

// 查询试题详细
export function getTopic(id) {
  return request({
    url: "/exam/topic/" + id,
    method: "get",
  });
}
// 查询试题详细（新）
export function getPaperTopic(topicId, titleId) {
  return request({
    url: `/exam/fixationPaper/getPaperTopic/${topicId}/${titleId}`,
    method: "get",
  });
}
// 新增试题
export function addTopic(data) {
  return request({
    url: "/exam/topic",
    method: "post",
    data: data,
  });
}

// 试题-导入列表验证
export function importValidate(data) {
  return request({
    url: "/exam/topic/importValidate",
    method: "post",
    data: data,
  });
}

// 试题-导入试题
export function importTopic(status, id, data) {
  return request({
    url: "/exam/topic/import/" + status + "/" + id,
    method: "post",
    data: data,
  });
}

// 修改试题
export function updateTopic(data) {
  return request({
    url: "/exam/topic",
    method: "put",
    data: data,
  });
}

// 删除试题
export function delTopic(id) {
  return request({
    url: "/exam/topic/" + id,
    method: "delete",
  });
}
